3v4l.org

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

Function getarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FRKv2
function name:  getArray
number of ops:  3
compiled vars:  !0 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > RETURN                                                   !0
    6     2*     > 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/FRKv2
function name:  squareArray
number of ops:  7
compiled vars:  !0 = $a, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1      > FE_RESET_RW                                      $2      !0, ->5
          2    > > FE_FETCH_RW                                              $2, !1, ->5
   10     3    >   ASSIGN_OP                                     3          !1, 2
    9     4      > JMP                                                      ->2
          5    >   FE_FREE                                                  $2
   12     6      > RETURN                                                   null

End of function squarearray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.82 ms | 1390 KiB | 18 Q