3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { private $x; public function setX($x) { $this->x = $x; } public function getX() { return $this->x; } } function test() : Foo { return new Foo; } $x = test()->setX('test'); var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aeNu7
function name:  (null)
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $1      
          2        INIT_METHOD_CALL                                         $1, 'setX'
          3        SEND_VAL_EX                                              'test'
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
   26     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aeNu7
function name:  test
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   22     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function test

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

End of function setx

Function getx:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aeNu7
function name:  getX
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~0      'x'
          1      > RETURN                                                   ~0
   16     2*     > RETURN                                                   null

End of function getx

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.68 ms | 1398 KiB | 16 Q