3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyObjectStorage extends SplObjectStorage { public function contains(object $o): bool { if ($o instanceof stdClass) { return true; } else { return false; } } } $std = new stdClass(); $storage = new MyObjectStorage(); var_dump($storage->contains($std)); var_dump(isset($storage[$std]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l913b
function name:  (null)
number of ops:  17
compiled vars:  !0 = $std, !1 = $storage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        NEW                                              $5      'MyObjectStorage'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   16     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !1, 'contains'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                                 
   17    12        INIT_FCALL                                               'var_dump'
         13        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !1, !0
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class MyObjectStorage:
Function contains:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l913b
function name:  contains
number of ops:  8
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INSTANCEOF                                               !0, 'stdClass'
          2      > JMPZ                                                     ~1, ->5
    6     3    > > RETURN                                                   <true>
    5     4*       JMP                                                      ->6
    8     5    > > RETURN                                                   <false>
   10     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function contains

End of class MyObjectStorage.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.78 ms | 998 KiB | 14 Q