3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myClass = [ 'attribute' => 0, 'method' => [ 'type' => 'static', 'accessibility' => 'public', 'code' => function () { echo($myClass['attribute']); } ] ]; function foo() { $bar = 'foo'; $baz = function () { echo($bar); }; $baz(); } $foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ghR5X
function name:  (null)
number of ops:  10
compiled vars:  !0 = $myClass, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_ARRAY                                       ~2      0, 'attribute'
    5     1        INIT_ARRAY                                       ~3      'static', 'type'
    6     2        ADD_ARRAY_ELEMENT                                ~3      'public', 'accessibility'
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FghR5X%3A7%240'
    9     4        ADD_ARRAY_ELEMENT                                ~3      ~4, 'code'
          5        ADD_ARRAY_ELEMENT                                ~2      ~3, 'method'
    2     6        ASSIGN                                                   !0, ~2
   19     7        INIT_DYNAMIC_CALL                                        !1
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FghR5X%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ghR5X
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $myClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_DIM_R                                      ~1      !0, 'attribute'
          1        ECHO                                                     ~1
    9     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FghR5X%3A7%240

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ghR5X
function name:  foo
number of ops:  6
compiled vars:  !0 = $bar, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'foo'
   14     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FghR5X%3A14%241'
          2        ASSIGN                                                   !1, ~3
   17     3        INIT_DYNAMIC_CALL                                        !1
          4        DO_FCALL                                      0          
   18     5      > RETURN                                                   null

End of function foo

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

End of function %00%7Bclosure%7D%2Fin%2FghR5X%3A14%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.14 ms | 1395 KiB | 13 Q