3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getArray() { return [1, 2, 3]; } function squareArray(array &$a) { foreach ($a as &$v) { $v **= 2; } } // Generates a warning in PHP 7. squareArray((getArray()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HYONN
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'squarearray'
          1        INIT_FCALL                                               'getarray'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF                               0          $0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function getarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HYONN
function name:  getArray
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   <array>
    5     1*     > RETURN                                                   null

End of function getarray

Function squarearray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/HYONN
function name:  squareArray
number of ops:  7
compiled vars:  !0 = $a, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1      > FE_RESET_RW                                      $2      !0, ->5
          2    > > FE_FETCH_RW                                              $2, !1, ->5
    9     3    >   ASSIGN_OP                                    12          !1, 2
    8     4      > JMP                                                      ->2
          5    >   FE_FREE                                                  $2
   11     6      > RETURN                                                   null

End of function squarearray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.36 ms | 1413 KiB | 15 Q