3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { static $count = 0; function __construct() { Example::count == Example::count + 1; } function getCount() { return Example::count; } } $instance = new Example(); echo $instance->getCount(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xghpr
function name:  (null)
number of ops:  7
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Example'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'getCount'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   24     6      > RETURN                                                   1

Class Example:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xghpr
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_CLASS_CONSTANT                             ~0      'Example', 'count'
          1        FETCH_CLASS_CONSTANT                             ~1      'Example', 'count'
          2        ADD                                              ~2      ~1, 1
          3        IS_EQUAL                                         ~3      ~0, ~2
          4        FREE                                                     ~3
   11     5      > RETURN                                                   null

End of function __construct

Function getcount:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xghpr
function name:  getCount
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_CLASS_CONSTANT                             ~0      'Example', 'count'
          1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function getcount

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.92 ms | 1394 KiB | 13 Q