3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestOb { public function has() { $myclass = get_class($this); if (serialize($this) == serialize(new $myclass)) { echo "SAME"; exit; } 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/FXtOk
function name:  (null)
number of ops:  8
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'TestOb'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        ASSIGN_OBJ                                               !0, 'derp'
          4        OP_DATA                                                  'test'
   15     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 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FXtOk
function name:  has
number of ops:  21
compiled vars:  !0 = $myclass, !1 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                       ~2      
          1        GET_CLASS                                        ~3      ~2
          2        ASSIGN                                                   !0, ~3
    5     3        INIT_FCALL                                               'serialize'
          4        FETCH_THIS                                       ~5      
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                         $6      
          7        INIT_FCALL                                               'serialize'
          8        FETCH_CLASS                                   0  $7      !0
          9        NEW                                              $8      $7
         10        DO_FCALL                                      0          
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $10     
         13        IS_EQUAL                                                 $6, $10
         14      > JMPZ                                                     ~11, ->17
    6    15    >   ECHO                                                     'SAME'
    7    16      > EXIT                                                     
    9    17    >   INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
   10    20      > RETURN                                                   null

End of function has

End of class TestOb.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.92 ms | 1396 KiB | 17 Q