3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getSomeArray(){ return ['a' => 34]; } function getSomeObject(){ $x = new StdClass(); $x->blah = 42; return $x; } // you don't need to 'prepare' anything, you will get exactly what those two functions above return. $a = getSomeArray(); var_dump($a); $b = getSomeObject(); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fJUAR
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'getsomearray'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   15     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   17     6        INIT_FCALL                                               'getsomeobject'
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !1, $5
   18     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function getsomearray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fJUAR
function name:  getSomeArray
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 getsomearray

Function getsomeobject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fJUAR
function name:  getSomeObject
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    8     3        ASSIGN_OBJ                                               !0, 'blah'
          4        OP_DATA                                                  42
    9     5      > RETURN                                                   !0
   10     6*     > RETURN                                                   null

End of function getsomeobject

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.25 ms | 1398 KiB | 17 Q