3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { $s = ""; $f = function($count) use (&$s) { if ($count <= 0) { return; } else { $s = $s."x"; $f($count-1); } }; $f(2); return $s; } echo test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IKYbZ
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IKYbZ
function name:  test
number of ops:  9
compiled vars:  !0 = $s, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, ''
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FIKYbZ%3A5%240'
          2        BIND_LEXICAL                                             ~3, !0
          3        ASSIGN                                                   !1, ~3
    8     4        INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0          
    9     7      > RETURN                                                   !0
   10     8*     > RETURN                                                   null

End of function test

Function %00%7Bclosure%7D%2Fin%2FIKYbZ%3A5%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 = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IKYbZ
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $count, !1 = $s, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    6     2        IS_SMALLER_OR_EQUAL                                      !0, 0
          3      > JMPZ                                                     ~3, ->6
          4    > > RETURN                                                   null
          5*       JMP                                                      ->12
          6    >   CONCAT                                           ~4      !1, 'x'
          7        ASSIGN                                                   !1, ~4
          8        INIT_DYNAMIC_CALL                                        !2
          9        SUB                                              ~6      !0, 1
         10        SEND_VAL_EX                                              ~6
         11        DO_FCALL                                      0          
    7    12      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FIKYbZ%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.95 ms | 1399 KiB | 14 Q