3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private string $foo; private array $bar; public function __construct(string $foo, array $bar) { $this->foo = $foo; $this->bar = $bar; } public function square(): array { return array_map(fn($x) => $x * $x, $this->bar); } } $foo = new Foo('hello', [1, 2, 3, 4]); print_r($foo); print_r($foo->square());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LL274
function name:  (null)
number of ops:  14
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Foo'
          1        SEND_VAL_EX                                              'hello'
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   19     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   21     8        INIT_FCALL                                               'print_r'
          9        INIT_METHOD_CALL                                         !0, 'square'
         10        DO_FCALL                                      0  $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

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

End of function __construct

Function square:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LL274
function name:  square
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                          ~0      [0]
          2        SEND_VAL                                                 ~0
          3        FETCH_OBJ_R                                      ~1      'bar'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        VERIFY_RETURN_TYPE                                       $2
          7      > RETURN                                                   $2
   14     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LL274
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        MUL                                              ~1      !0, !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 0

End of function square

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.52 ms | 1004 KiB | 15 Q