3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends ArrayObject { public $a=1; public $b=true; public $c=2.0; public function getIterator(){ return new ArrayIterator(get_object_vars($this)); } } function test($a, $b, $c) { var_dump(func_get_args()); } $a = new A; test(...$a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ANq0r
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'test'
          4        SEND_UNPACK                                              !0
          5        CHECK_UNDEF_ARGS                                         
          6        DO_FCALL                                      1          
          7      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ANq0r
function name:  test
number of ops:  8
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   14     3        INIT_FCALL                                               'var_dump'
          4        FUNC_GET_ARGS                                    ~3      
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                                 
   15     7      > RETURN                                                   null

End of function test

Class A:
Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ANq0r
function name:  getIterator
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $0      'ArrayIterator'
          1        INIT_FCALL                                               'get_object_vars'
          2        FETCH_THIS                                       ~1      
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0          
          7      > RETURN                                                   $0
   10     8*     > RETURN                                                   null

End of function getiterator

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.98 ms | 1390 KiB | 18 Q