3v4l.org

run code in 300+ PHP versions simultaneously
<?php $serializable = array(); $sleep = array(); $wakeup = array(); foreach(get_declared_classes() as $class) { $reflection = new ReflectionClass($class); if($reflection->implementsInterface('Serializable')) { $serializable[] = $class; } if($reflection->hasMethod('__sleep')) { $sleep[] = $class; } if($reflection->hasMethod('__wakeup')) { $wakeup[] = $class; } if($reflection->hasMethod('__toString')) { $dest[] = $class; } } var_dump($sleep); var_dump($wakeup); var_dump($dest);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 36
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 36
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 35
Branch analysis from position: 29
Branch analysis from position: 23
Branch analysis from position: 17
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/oeBRc
function name:  (null)
number of ops:  47
compiled vars:  !0 = $serializable, !1 = $sleep, !2 = $wakeup, !3 = $class, !4 = $reflection, !5 = $dest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    7     3        INIT_FCALL                                               'get_declared_classes'
          4        DO_ICALL                                         $9      
          5      > FE_RESET_R                                       $10     $9, ->36
          6    > > FE_FETCH_R                                               $10, !3, ->36
    8     7    >   NEW                                              $11     'ReflectionClass'
          8        SEND_VAR_EX                                              !3
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !4, $11
    9    11        INIT_METHOD_CALL                                         !4, 'implementsInterface'
         12        SEND_VAL_EX                                              'Serializable'
         13        DO_FCALL                                      0  $14     
         14      > JMPZ                                                     $14, ->17
   10    15    >   ASSIGN_DIM                                               !0
         16        OP_DATA                                                  !3
   13    17    >   INIT_METHOD_CALL                                         !4, 'hasMethod'
         18        SEND_VAL_EX                                              '__sleep'
         19        DO_FCALL                                      0  $16     
         20      > JMPZ                                                     $16, ->23
   14    21    >   ASSIGN_DIM                                               !1
         22        OP_DATA                                                  !3
   17    23    >   INIT_METHOD_CALL                                         !4, 'hasMethod'
         24        SEND_VAL_EX                                              '__wakeup'
         25        DO_FCALL                                      0  $18     
         26      > JMPZ                                                     $18, ->29
   18    27    >   ASSIGN_DIM                                               !2
         28        OP_DATA                                                  !3
   20    29    >   INIT_METHOD_CALL                                         !4, 'hasMethod'
         30        SEND_VAL_EX                                              '__toString'
         31        DO_FCALL                                      0  $20     
         32      > JMPZ                                                     $20, ->35
   21    33    >   ASSIGN_DIM                                               !5
         34        OP_DATA                                                  !3
    7    35    > > JMP                                                      ->6
         36    >   FE_FREE                                                  $10
   25    37        INIT_FCALL                                               'var_dump'
         38        SEND_VAR                                                 !1
         39        DO_ICALL                                                 
   26    40        INIT_FCALL                                               'var_dump'
         41        SEND_VAR                                                 !2
         42        DO_ICALL                                                 
   27    43        INIT_FCALL                                               'var_dump'
         44        SEND_VAR                                                 !5
         45        DO_ICALL                                                 
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.06 ms | 1400 KiB | 17 Q