3v4l.org

run code in 300+ PHP versions simultaneously
<?php class someclass { public function Blah($parameter) { $parameter = 'test'; $anonymous = function() use ($parameter, &$anon) { if($parameter == 'test') $anon = "This works"; else $anon = "This doesn't work"; }; $anonymous(); echo $anon; } } $someclass = new someclass(); $someclass->Blah('test');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hvdQ3
function name:  (null)
number of ops:  7
compiled vars:  !0 = $someclass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'someclass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'Blah'
          4        SEND_VAL_EX                                              'test'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhvdQ3%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hvdQ3
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $parameter, !1 = $anon
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
    7     2        IS_EQUAL                                                 !0, 'test'
          3      > JMPZ                                                     ~2, ->6
    8     4    >   ASSIGN                                                   !1, 'This+works'
          5      > JMP                                                      ->7
   10     6    >   ASSIGN                                                   !1, 'This+doesn%27t+work'
   11     7    > > RETURN                                                   null

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

Class someclass:
Function blah:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hvdQ3
function name:  Blah
number of ops:  10
compiled vars:  !0 = $parameter, !1 = $anonymous, !2 = $anon
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !0, 'test'
    6     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhvdQ3%3A6%240'
          3        BIND_LEXICAL                                             ~4, !0
          4        BIND_LEXICAL                                             ~4, !2
          5        ASSIGN                                                   !1, ~4
   12     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0          
   13     8        ECHO                                                     !2
   14     9      > RETURN                                                   null

End of function blah

End of class someclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.44 ms | 1386 KiB | 13 Q