diff --git a/src/main/QafooLabs/Profiler.php b/src/main/QafooLabs/Profiler.php
index <HASH>..<HASH> 100644
--- a/src/main/QafooLabs/Profiler.php
+++ b/src/main/QafooLabs/Profiler.php
@@ -248,7 +248,11 @@ class Profiler
         }
 
         $enable = self::$extensionPrefix . '_layers_enable';
-        $enable($options['layers'], self::$framework);
+        if ($enable === 'xhprof_layers_enable') {
+            $enable($options['layers']);
+        } else {
+            $enable($options['layers'], self::$framework);
+        }
 
         self::$sampling = true;
     }
Bugfix with xhprof_layers_enable