3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $a; public function foo() { strtolower( function () { set_error_handler(function() {}); $class = get_called_class(); restore_error_handler(); return $class; }); $f = function() { }; $f(); } } $a = new A; $a->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KCfKL
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FKCfKL%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KCfKL
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKCfKL%3A7%241'
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
    8     4        GET_CALLED_CLASS                                 ~3      
          5        ASSIGN                                                   !0, ~3
    9     6        INIT_FCALL                                               'restore_error_handler'
          7        DO_ICALL                                                 
   11     8      > RETURN                                                   !0
   12     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKCfKL%3A6%240

Function %00%7Bclosure%7D%2Fin%2FKCfKL%3A7%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KCfKL
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKCfKL%3A7%241

Function %00%7Bclosure%7D%2Fin%2FKCfKL%3A14%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KCfKL
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKCfKL%3A14%242

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KCfKL
function name:  foo
number of ops:  9
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'strtolower'
    6     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKCfKL%3A6%240'
   12     2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   14     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKCfKL%3A14%242'
          5        ASSIGN                                                   !0, ~3
   17     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
   18     8      > RETURN                                                   null

End of function foo

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.75 ms | 1400 KiB | 19 Q