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"; } } $a = new A(); $b = new A(); $c = new A(); $d = new A(); echo $a, $b, $c, $d;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8EuBb
function name:  (null)
number of ops:  18
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'
   14     1        NEW                                              $4      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   15     4        NEW                                              $7      'A'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
   16     7        NEW                                              $10     'A'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $10
   17    10        NEW                                              $13     'A'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !3, $13
   19    13        ECHO                                                     !0
         14        ECHO                                                     !1
         15        ECHO                                                     !2
         16        ECHO                                                     !3
         17      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8EuBb
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/8EuBb
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

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
236.9 ms | 1395 KiB | 13 Q