3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { var $id; function Foo() { static $counter = 0; $this->id = $counter++; if ($counter > PHP_INT_MAX) { $counter = PHP_INT_MIN; } } } $i1 = new Foo; var_dump($i1->id); $i2 = new Foo; var_dump($i2->id); $i3 = new Foo; var_dump($i3->id); $i4 = new Foo; var_dump($i4->id);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X2BV4
function name:  (null)
number of ops:  29
compiled vars:  !0 = $i1, !1 = $i2, !2 = $i3, !3 = $i4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $4      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   18     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~7      !0, 'id'
          5        SEND_VAL                                                 ~7
          6        DO_ICALL                                                 
   19     7        NEW                                              $9      'Foo'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $9
   20    10        INIT_FCALL                                               'var_dump'
         11        FETCH_OBJ_R                                      ~12     !1, 'id'
         12        SEND_VAL                                                 ~12
         13        DO_ICALL                                                 
   21    14        NEW                                              $14     'Foo'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !2, $14
   22    17        INIT_FCALL                                               'var_dump'
         18        FETCH_OBJ_R                                      ~17     !2, 'id'
         19        SEND_VAL                                                 ~17
         20        DO_ICALL                                                 
   23    21        NEW                                              $19     'Foo'
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !3, $19
   24    24        INIT_FCALL                                               'var_dump'
         25        FETCH_OBJ_R                                      ~22     !3, 'id'
         26        SEND_VAL                                                 ~22
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Class Foo:
Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/X2BV4
function name:  Foo
number of ops:  8
compiled vars:  !0 = $counter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        POST_INC                                         ~2      !0
          2        ASSIGN_OBJ                                               'id'
          3        OP_DATA                                                  ~2
   11     4        IS_SMALLER                                               9223372036854775807, !0
          5      > JMPZ                                                     ~3, ->7
   12     6    >   ASSIGN                                                   !0, -9223372036854775808
   14     7    > > RETURN                                                   null

End of function foo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
207.21 ms | 1396 KiB | 15 Q