3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private static $_count = 0; function __construct() { static::$_count++; } public function __toString(){ return static::$_count . "\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/Vi8LT
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'
   13     1        NEW                                              $4      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   14     4        NEW                                              $7      'A'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
   15     7        NEW                                              $10     'A'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $10
   16    10        NEW                                              $13     'A'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !3, $13
   18    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/Vi8LT
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   PRE_INC_STATIC_PROP                                      '_count'
    6     1      > 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/Vi8LT
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      '_count'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   10     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __tostring

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.04 ms | 1395 KiB | 13 Q