3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private static $_count = 0; private $_number; function __construct() { $this->_number = ++static::$_count; } public function __toString(){ return static::$_count . ' | ' . $this->_number . "\n"; } public function __invoke(){ return $this->_number; } } class B { private $_status = array(); } $a = new A(); $b = new A(); $c = new A(); $d = new A(); echo $a, $b, $c, $d; echo $a(), $b(), $c(), $d();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o2WX2
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'a'
   23     1        NEW                                              $4      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   24     4        NEW                                              $7      'A'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
   25     7        NEW                                              $10     'A'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $10
   26    10        NEW                                              $13     'A'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !3, $13
   28    13        ECHO                                                     !0
         14        ECHO                                                     !1
         15        ECHO                                                     !2
         16        ECHO                                                     !3
   29    17        INIT_DYNAMIC_CALL                                        !0
         18        DO_FCALL                                      0  $16     
         19        ECHO                                                     $16
         20        INIT_DYNAMIC_CALL                                        !1
         21        DO_FCALL                                      0  $17     
         22        ECHO                                                     $17
         23        INIT_DYNAMIC_CALL                                        !2
         24        DO_FCALL                                      0  $18     
         25        ECHO                                                     $18
         26        INIT_DYNAMIC_CALL                                        !3
         27        DO_FCALL                                      0  $19     
         28        ECHO                                                     $19
         29      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o2WX2
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   PRE_INC_STATIC_PROP                              ~1      '_count'
          1        ASSIGN_OBJ                                               '_number'
          2        OP_DATA                                                  ~1
    7     3      > RETURN                                                   null

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o2WX2
function name:  __toString
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      '_count'
          1        CONCAT                                           ~1      ~0, '+%7C+'
          2        FETCH_OBJ_R                                      ~2      '_number'
          3        CONCAT                                           ~3      ~1, ~2
          4        CONCAT                                           ~4      ~3, '%0A'
          5        VERIFY_RETURN_TYPE                                       ~4
          6      > RETURN                                                   ~4
   11     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

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

End of function __invoke

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.5 ms | 1399 KiB | 13 Q