3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = [1,2,3]; $a[] = &$a; print_r($a); function foo($a) { foreach($a as $b) { if (is_array($b)) { foo($b); } else { print $b.PHP_EOL; } } } // Infinite call //foo($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SXEbV
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        FETCH_DIM_W                                          $2      !0
          2        ASSIGN_REF                                                   $2, !0
    6     3        INIT_FCALL                                                   'print_r'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                                     
   19     6      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/SXEbV
function name:  foo
number of ops:  14
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1      > FE_RESET_R                                           $2      !0, ->12
          2    > > FE_FETCH_R                                                   $2, !1, ->12
   10     3    >   TYPE_CHECK                                      128          !1
          4      > JMPZ                                                         ~3, ->9
   11     5    >   INIT_FCALL_BY_NAME                                           'foo'
          6        SEND_VAR_EX                                                  !1
          7        DO_FCALL                                          0          
   10     8      > JMP                                                          ->11
   13     9    >   CONCAT                                               ~5      !1, '%0A'
         10        ECHO                                                         ~5
    9    11    > > JMP                                                          ->2
         12    >   FE_FREE                                                      $2
   16    13      > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
150.9 ms | 2785 KiB | 9 Q