3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump found. (Code = 62) Position 1 = -2
filename:       /in/HYONN
function name:  (null)
number of ops:  8
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   7     1        NOP                                                      
  14     2        INIT_FCALL                                               'squarearray'
         3        INIT_FCALL                                               'getarray'
         4        DO_FCALL                                      0  $0      
         5        SEND_VAR_NO_REF                               0          $0
         6        DO_FCALL                                      0          
         7      > RETURN                                                   1

Function getarray:
Finding entry points
Branch analysis from position: 0
Jump 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
Jump found. (Code = 125) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
Jump found. (Code = 126) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
Jump found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 5
Jump 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_POW                                               !1, 2
         4      > JMP                                                      ->2
         5    >   FE_FREE                                                  $2
  11     6      > RETURN                                                   null

End of function squarearray

Generated using Vulcan Logic Dumper, using php 7.1.0