3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Test; class Test { private $s; private $i; public function __construct(string $s, int $i) { $this->s = $s; $this->i = $i; } public function foo() { return 's: ' . $this->s . ', i: ' . $this->i; } public function __toString() { return $this->s; } } $a = new Test(new Test('Hello, world!', 2016), '2015'); echo $a->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XHjI2
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'test%5Ctest'
   26     1        NEW                                              $1      'Test%5CTest'
          2        NEW                                              $2      'Test%5CTest'
          3        SEND_VAL_EX                                              'Hello%2C+world%21'
          4        SEND_VAL_EX                                              2016
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $2
          7        SEND_VAL_EX                                              '2015'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $1
   27    10        INIT_METHOD_CALL                                         !0, 'foo'
         11        DO_FCALL                                      0  $6      
         12        ECHO                                                     $6
         13      > RETURN                                                   1

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

End of function __construct

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XHjI2
function name:  foo
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      's'
          1        CONCAT                                           ~1      's%3A+', ~0
          2        CONCAT                                           ~2      ~1, '%2C+i%3A+'
          3        FETCH_OBJ_R                                      ~3      'i'
          4        CONCAT                                           ~4      ~2, ~3
          5      > RETURN                                                   ~4
   18     6*     > RETURN                                                   null

End of function foo

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XHjI2
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   FETCH_OBJ_R                                      ~0      's'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   23     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

End of class Test\Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.21 ms | 1399 KiB | 13 Q