3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestOb { public function has() { $str = serialize($this); if ($str == serialize(new TestOb)) { echo "SAME"; } print_R($str); } } $d = new TestOb(); $d->derp = "test"; $d->has();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dUJFj
function name:  (null)
number of ops:  8
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'TestOb'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        ASSIGN_OBJ                                               !0, 'derp'
          4        OP_DATA                                                  'test'
   14     5        INIT_METHOD_CALL                                         !0, 'has'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class TestOb:
Function has:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/dUJFj
function name:  has
number of ops:  17
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'serialize'
          1        FETCH_THIS                                       ~1      
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    5     5        INIT_FCALL                                               'serialize'
          6        NEW                                              $4      'TestOb'
          7        DO_FCALL                                      0          
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $6      
         10        IS_EQUAL                                                 !0, $6
         11      > JMPZ                                                     ~7, ->13
    6    12    >   ECHO                                                     'SAME'
    8    13    >   INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
    9    16      > RETURN                                                   null

End of function has

End of class TestOb.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.89 ms | 1395 KiB | 17 Q