3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestOb { public function has() { $myclass = get_class($this); return (serialize($this) != serialize(new $myclass)); } } $d = new TestOb(); if ($d->has()) { echo "has"; exit; } echo "Doesn't has";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O0D9p
function name:  (null)
number of ops:  10
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'TestOb'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_METHOD_CALL                                         !0, 'has'
          4        DO_FCALL                                      0  $4      
          5      > JMPZ                                                     $4, ->8
   11     6    >   ECHO                                                     'has'
   12     7      > EXIT                                                     
   14     8    >   ECHO                                                     'Doesn%27t+has'
          9      > RETURN                                                   1

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

End of function has

End of class TestOb.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.63 ms | 1388 KiB | 15 Q