3v4l.org

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

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KJNIZ
function name:  call
number of ops:  5
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
    4     4*     > RETURN                                                   null

End of function call

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

End of function %00%7Bclosure%7D%2Fin%2FKJNIZ%3A9%240

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

End of function %00%7Bclosure%7D%2Fin%2FKJNIZ%3A10%241

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KJNIZ
function name:  foo
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'strtolower'
    9     2        INIT_FCALL                                               'call'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKJNIZ%3A9%240'
   15     4        SEND_VAL                                                 ~0
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   16    10      > RETURN                                                   null

End of function foo

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
335.52 ms | 1402 KiB | 23 Q