3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test extends \SplObjectStorage { /** * {@inheritDoc} */ public function attach($object, $data = null) { throw new \RuntimeException('this is a test'); } } $instance = new Test; $object = new \stdClass; $data = ['foo' => 'bar']; $instance[$object] = $data; // should throw RuntimeException /* http://php.net/manual/en/splobjectstorage.offsetset.php Note: SplObjectStorage::offsetSet() is an alias of SplObjectStorage::attach(). */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mXdWO
function name:  (null)
number of ops:  10
compiled vars:  !0 = $instance, !1 = $object, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   15     3        NEW                                              $6      'stdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   16     6        ASSIGN                                                   !2, <array>
   18     7        ASSIGN_DIM                                               !0, !1
          8        OP_DATA                                                  !2
   24     9      > RETURN                                                   1

Class Test:
Function attach:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/mXdWO
function name:  attach
number of ops:  7
compiled vars:  !0 = $object, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   10     2        NEW                                              $2      'RuntimeException'
          3        SEND_VAL_EX                                              'this+is+a+test'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $2
   11     6*     > RETURN                                                   null

End of function attach

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.07 ms | 1394 KiB | 13 Q