3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function bar(string $foo) : string { return strtoupper($foo); } protected $foosdone = []; function __construct(array $foos) { $this->foosdone = array_map([$this, 'bar'], $foos); } } new Foo(['a', 'b', 'c']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oqsTm
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $0      'Foo'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        FREE                                                     $0
          4      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oqsTm
function name:  bar
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'strtoupper'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
    6     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function bar

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oqsTm
function name:  __construct
number of ops:  11
compiled vars:  !0 = $foos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'array_map'
          2        FETCH_THIS                                       ~2      
          3        INIT_ARRAY                                       ~3      ~2
          4        ADD_ARRAY_ELEMENT                                ~3      'bar'
          5        SEND_VAL                                                 ~3
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        ASSIGN_OBJ                                               'foosdone'
          9        OP_DATA                                                  $4
   12    10      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.23 ms | 1401 KiB | 17 Q