3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { return array(1,2,3,4); } } $tmp = Foo::bar(); var_dump(array_pop($tmp)); var_dump(array_pop(Foo::bar())); // Works with HHVM, PHP: Strict Standards: Only variables should be passed by reference in /in/7aWJe on line 10 var_dump(array_splice(Foo::bar(),2)); // Works with HHVM, PHP: Strict Standards: Only variables should be passed by reference in /in/7aWJe on line 11 //var_dump(array_splice(array(1,2,3,4),2)); // Works with HHVM, PHP: Fatal error: Only variables can be passed by reference in /in/Z57M3 on line 12
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d51DQ
function name:  (null)
number of ops:  27
compiled vars:  !0 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo', 'bar'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    9     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'array_pop'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
   10     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'array_pop'
         11        INIT_STATIC_METHOD_CALL                                  'Foo', 'bar'
         12        DO_FCALL                                      0  $5      
         13        SEND_VAR_NO_REF                               0          $5
         14        DO_ICALL                                         $6      
         15        SEND_VAR                                                 $6
         16        DO_ICALL                                                 
   11    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'array_splice'
         19        INIT_STATIC_METHOD_CALL                                  'Foo', 'bar'
         20        DO_FCALL                                      0  $8      
         21        SEND_VAR_NO_REF                               0          $8
         22        SEND_VAL                                                 2
         23        DO_ICALL                                         $9      
         24        SEND_VAR                                                 $9
         25        DO_ICALL                                                 
   12    26      > RETURN                                                   1

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

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.16 ms | 1396 KiB | 19 Q