3v4l.org

run code in 500+ PHP versions simultaneously
<?php require 'fuzz_lib.php'; $tests = [ 'Iterator', 'IteratorAggregate', 'Traversable', 'ArrayAccess', 'Countable', 'Serializable', 'JsonSerializable', 'Stringable', 'Throwable', 'DateTimeInterface', 'Reflector', ]; foreach ($tests as $t) { $v = makeValueForType($t); $cls = is_object($v) ? get_class($v) : gettype($v); $ok = is_object($v) && (new ReflectionClass($v))->implementsInterface($t) ? 'OK' : 'NO'; echo "$t => $cls [$ok]\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 38
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 38
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
Branch analysis from position: 25
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/VGPaD
function name:  (null)
number of ops:  40
compiled vars:  !0 = $tests, !1 = $t, !2 = $v, !3 = $cls, !4 = $ok
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                              'fuzz_lib.php', REQUIRE
    3     1        ASSIGN                                                       !0, <array>
    8     2      > FE_RESET_R                                           $7      !0, ->38
          3    > > FE_FETCH_R                                                   $7, !1, ->38
    9     4    >   INIT_FCALL_BY_NAME                                           'makeValueForType'
          5        SEND_VAR_EX                                                  !1
          6        DO_FCALL                                          0  $8      
          7        ASSIGN                                                       !2, $8
   10     8        TYPE_CHECK                                      256          !2
          9      > JMPZ                                                         ~10, ->13
         10    >   GET_CLASS                                            ~11     !2
         11        QM_ASSIGN                                            ~12     ~11
         12      > JMP                                                          ->15
         13    >   GET_TYPE                                             ~13     !2
         14        QM_ASSIGN                                            ~12     ~13
         15    >   ASSIGN                                                       !3, ~12
   11    16        TYPE_CHECK                                      256  ~15     !2
         17      > JMPZ_EX                                              ~15     ~15, ->25
         18    >   NEW                                                  $16     'ReflectionClass'
         19        SEND_VAR_EX                                                  !2
         20        DO_FCALL                                          0          
         21        INIT_METHOD_CALL                                             $16, 'implementsInterface'
         22        SEND_VAR_EX                                                  !1
         23        DO_FCALL                                          0  $18     
         24        BOOL                                                 ~15     $18
         25    > > JMPZ                                                         ~15, ->28
         26    >   QM_ASSIGN                                            ~19     'OK'
         27      > JMP                                                          ->29
         28    >   QM_ASSIGN                                            ~19     'NO'
         29    >   ASSIGN                                                       !4, ~19
   12    30        ROPE_INIT                                         6  ~22     !1
         31        ROPE_ADD                                          1  ~22     ~22, '+%3D%3E+'
         32        ROPE_ADD                                          2  ~22     ~22, !3
         33        ROPE_ADD                                          3  ~22     ~22, '+%5B'
         34        ROPE_ADD                                          4  ~22     ~22, !4
         35        ROPE_END                                          5  ~21     ~22, '%5D%0A'
         36        ECHO                                                         ~21
    8    37      > JMP                                                          ->3
         38    >   FE_FREE                                                      $7
   13    39      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.29 ms | 495 KiB | 9 Q