3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test {} function addToStorage(\SplObjectStorage $storage, Test $test) { if (!$storage->contains($test)) { $storage->attach($test); } } class OneSpecimenPerClassStorage extends \SplObjectStorage { public function getHash($o) { return get_class($o); } } $storage = new \OneSpecimenPerClassStorage(); $test1 = new Test(); $test2 = new Test(); addToStorage($storage, $test1); addToStorage($storage, $test2); echo $storage->count();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JM0WL
function name:  (null)
number of ops:  21
compiled vars:  !0 = $storage, !1 = $test1, !2 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $3      'OneSpecimenPerClassStorage'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   19     3        NEW                                              $6      'Test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   20     6        NEW                                              $9      'Test'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $9
   22     9        INIT_FCALL                                               'addtostorage'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        DO_FCALL                                      0          
   23    13        INIT_FCALL                                               'addtostorage'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !2
         16        DO_FCALL                                      0          
   25    17        INIT_METHOD_CALL                                         !0, 'count'
         18        DO_FCALL                                      0  $14     
         19        ECHO                                                     $14
         20      > RETURN                                                   1

Function addtostorage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/JM0WL
function name:  addToStorage
number of ops:  11
compiled vars:  !0 = $storage, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_METHOD_CALL                                         !0, 'contains'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0  $2      
          5        BOOL_NOT                                         ~3      $2
          6      > JMPZ                                                     ~3, ->10
    7     7    >   INIT_METHOD_CALL                                         !0, 'attach'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
    9    10    > > RETURN                                                   null

End of function addtostorage

Class Test: [no user functions]
Class OneSpecimenPerClassStorage:
Function gethash:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JM0WL
function name:  getHash
number of ops:  4
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        GET_CLASS                                        ~1      !0
          2      > RETURN                                                   ~1
   14     3*     > RETURN                                                   null

End of function gethash

End of class OneSpecimenPerClassStorage.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.47 ms | 1403 KiB | 15 Q