3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo1() { echo 1; } $foo1 = 'foo1'; $foo1(); $foo2 = function () { echo 2; }; $foo2(); class Three { public function __invoke() { echo 3; } } $foo3 = new Three(); $foo3(); class Bar { static function foo4() { echo 4;} function foo5() { echo 5; } static function foo6() { echo 6;} } $foo3 = array('Bar','foo4'); $foo3(); // we should make this work $foo4 = array(new Bar, 'foo5'); $foo4(); // we should make this work $foo6 = [Bar::class, 'foo6']; $foo6();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qY7IW
function name:  (null)
number of ops:  26
compiled vars:  !0 = $foo1, !1 = $foo2, !2 = $foo3, !3 = $foo4, !4 = $foo6
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'foo1'
    5     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
    8     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqY7IW%3A8%240'
          4        ASSIGN                                                   !1, ~7
    9     5        INIT_DYNAMIC_CALL                                        !1
          6        DO_FCALL                                      0          
   15     7        NEW                                              $10     'Three'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $10
   16    10        INIT_DYNAMIC_CALL                                        !2
         11        DO_FCALL                                      0          
   23    12        ASSIGN                                                   !2, <array>
   24    13        INIT_DYNAMIC_CALL                                        !2
         14        DO_FCALL                                      0          
   27    15        NEW                                              $16     'Bar'
         16        DO_FCALL                                      0          
         17        INIT_ARRAY                                       ~18     $16
         18        ADD_ARRAY_ELEMENT                                ~18     'foo5'
         19        ASSIGN                                                   !3, ~18
   28    20        INIT_DYNAMIC_CALL                                        !3
         21        DO_FCALL                                      0          
   30    22        ASSIGN                                                   !4, <array>
   31    23        INIT_DYNAMIC_CALL                                        !4
         24        DO_FCALL                                      0          
         25      > RETURN                                                   1

Function foo1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qY7IW
function name:  foo1
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     1
          1      > RETURN                                                   null

End of function foo1

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

End of function %00%7Bclosure%7D%2Fin%2FqY7IW%3A8%240

Class Three:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qY7IW
function name:  __invoke
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     3
          1      > RETURN                                                   null

End of function __invoke

End of class Three.

Class Bar:
Function foo4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qY7IW
function name:  foo4
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     4
          1      > RETURN                                                   null

End of function foo4

Function foo5:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qY7IW
function name:  foo5
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     5
          1      > RETURN                                                   null

End of function foo5

Function foo6:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qY7IW
function name:  foo6
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     6
          1      > RETURN                                                   null

End of function foo6

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 1390 KiB | 13 Q