3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Collection { /** @var string */ private $type; /** * @param string $type */ public static function ofType($type) { $collection = new static(); $collection->type = $type; } } final class Person {} $col = Collection::ofType(Person::class); function parsePersonCollection(PersonCollection $coll) { } parsePersonCollection($col);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rLP1E
function name:  (null)
number of ops:  8
compiled vars:  !0 = $col
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'Collection', 'ofType'
          1        SEND_VAL                                                 'Person'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   26     4        INIT_FCALL                                               'parsepersoncollection'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function parsepersoncollection:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rLP1E
function name:  parsePersonCollection
number of ops:  2
compiled vars:  !0 = $coll
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   24     1      > RETURN                                                   null

End of function parsepersoncollection

Class Collection:
Function oftype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rLP1E
function name:  ofType
number of ops:  7
compiled vars:  !0 = $type, !1 = $collection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        NEW                          static              $2      
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
   13     4        ASSIGN_OBJ                                               !1, 'type'
          5        OP_DATA                                                  !0
   14     6      > RETURN                                                   null

End of function oftype

End of class Collection.

Class Person: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.29 ms | 1398 KiB | 14 Q