3v4l.org

run code in 300+ PHP versions simultaneously
<?php class someclass { public function Blah($parameter) { $parameter = 'test'; $anon = function() use ($parameter) { if($parameter == 'test') return "This works"; else return "This doesn't work"; }; 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/a9YUl
function name:  (null)
number of ops:  7
compiled vars:  !0 = $someclass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'someclass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'Blah'
          4        SEND_VAL_EX                                              'test'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

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

Class someclass:
Function blah:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a9YUl
function name:  Blah
number of ops:  9
compiled vars:  !0 = $parameter, !1 = $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%2Fa9YUl%3A6%240'
          3        BIND_LEXICAL                                             ~3, !0
          4        ASSIGN                                                   !1, ~3
   12     5        INIT_DYNAMIC_CALL                                        !1
          6        DO_FCALL                                      0  $5      
          7        ECHO                                                     $5
   13     8      > RETURN                                                   null

End of function blah

End of class someclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.58 ms | 1386 KiB | 13 Q