3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!defined('PHP_INT_MAX')) { $min = -1; do { $last = $min; $min <<= 1; } while($min < 0); define('PHP_INT_MIN', $last); define('PHP_INT_MAX', ~$last); } 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
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 15
Branch analysis from position: 1
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
Branch analysis from position: 15
filename:       /in/SleUj
function name:  (null)
number of ops:  44
compiled vars:  !0 = $min, !1 = $last, !2 = $i1, !3 = $i2, !4 = $i3, !5 = $i4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     <false>, ->15
    4     1    >   ASSIGN                                                   !0, -1
    6     2    >   ASSIGN                                                   !1, !0
    7     3        ASSIGN_OP                                     6          !0, 1
    8     4        IS_SMALLER                                               !0, 0
          5      > JMPNZ                                                    ~9, ->2
   10     6    >   INIT_FCALL                                               'define'
          7        SEND_VAL                                                 'PHP_INT_MIN'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   11    10        INIT_FCALL                                               'define'
         11        SEND_VAL                                                 'PHP_INT_MAX'
         12        BW_NOT                                           ~11     !1
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                                 
   29    15    >   NEW                                              $13     'Foo'
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $13
   30    18        INIT_FCALL                                               'var_dump'
         19        FETCH_OBJ_R                                      ~16     !2, 'id'
         20        SEND_VAL                                                 ~16
         21        DO_ICALL                                                 
   31    22        NEW                                              $18     'Foo'
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !3, $18
   32    25        INIT_FCALL                                               'var_dump'
         26        FETCH_OBJ_R                                      ~21     !3, 'id'
         27        SEND_VAL                                                 ~21
         28        DO_ICALL                                                 
   33    29        NEW                                              $23     'Foo'
         30        DO_FCALL                                      0          
         31        ASSIGN                                                   !4, $23
   34    32        INIT_FCALL                                               'var_dump'
         33        FETCH_OBJ_R                                      ~26     !4, 'id'
         34        SEND_VAL                                                 ~26
         35        DO_ICALL                                                 
   35    36        NEW                                              $28     'Foo'
         37        DO_FCALL                                      0          
         38        ASSIGN                                                   !5, $28
   36    39        INIT_FCALL                                               'var_dump'
         40        FETCH_OBJ_R                                      ~31     !5, 'id'
         41        SEND_VAL                                                 ~31
         42        DO_ICALL                                                 
         43      > 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/SleUj
function name:  Foo
number of ops:  8
compiled vars:  !0 = $counter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   BIND_STATIC                                              !0
   21     1        POST_INC                                         ~2      !0
          2        ASSIGN_OBJ                                               'id'
          3        OP_DATA                                                  ~2
   23     4        IS_SMALLER                                               9223372036854775807, !0
          5      > JMPZ                                                     ~3, ->7
   24     6    >   ASSIGN                                                   !0, -9223372036854775808
   26     7    > > RETURN                                                   null

End of function foo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.24 ms | 1400 KiB | 17 Q