3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getTime() { $arg1 = func_get_arg(0); $arg2 = func_get_arg(1); if (is_string($arg1)) { $format = $arg1; } elseif (is_string($arg2)) { $format = $arg2; } else { $format = 'H:i:s'; } if (is_int($arg1)) { $time = $arg1; } elseif (is_int($arg2)) { $time = $arg2; } else { $time = time(); } return date($format, $time); } function testGetTime() { $time = time(); $results = array( date('H:i:s', $time) === getTime($time), date('H:i:s', $time) === getTime(), date('H:i:s', $time) === getTime('H:i:s'), date('H:i', $time) === getTime('H:i', $time), date('H:i', $time) === getTime($time, 'H:i'), ); var_dump($results); } testGetTime();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7mOS
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   INIT_FCALL                                               'testgettime'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function gettime:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
Branch analysis from position: 21
filename:       /in/Q7mOS
function name:  getTime
number of ops:  34
compiled vars:  !0 = $arg1, !1 = $arg2, !2 = $format, !3 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'func_get_arg'
          1        SEND_VAL                                                 0
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    7     4        INIT_FCALL                                               'func_get_arg'
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
    9     8        TYPE_CHECK                                   64          !0
          9      > JMPZ                                                     ~8, ->12
   10    10    >   ASSIGN                                                   !2, !0
         11      > JMP                                                      ->17
   11    12    >   TYPE_CHECK                                   64          !1
         13      > JMPZ                                                     ~10, ->16
   12    14    >   ASSIGN                                                   !2, !1
         15      > JMP                                                      ->17
   14    16    >   ASSIGN                                                   !2, 'H%3Ai%3As'
   17    17    >   TYPE_CHECK                                   16          !0
         18      > JMPZ                                                     ~13, ->21
   18    19    >   ASSIGN                                                   !3, !0
         20      > JMP                                                      ->28
   19    21    >   TYPE_CHECK                                   16          !1
         22      > JMPZ                                                     ~15, ->25
   20    23    >   ASSIGN                                                   !3, !1
         24      > JMP                                                      ->28
   22    25    >   INIT_FCALL                                               'time'
         26        DO_ICALL                                         $17     
         27        ASSIGN                                                   !3, $17
   25    28    >   INIT_FCALL                                               'date'
         29        SEND_VAR                                                 !2
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                         $19     
         32      > RETURN                                                   $19
   27    33*     > RETURN                                                   null

End of function gettime

Function testgettime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7mOS
function name:  testGetTime
number of ops:  54
compiled vars:  !0 = $time, !1 = $results
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $2      
          2        ASSIGN                                                   !0, $2
   32     3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'H%3Ai%3As'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        INIT_FCALL                                               'gettime'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0  $5      
         10        IS_IDENTICAL                                     ~6      $4, $5
         11        INIT_ARRAY                                       ~7      ~6
   33    12        INIT_FCALL                                               'date'
         13        SEND_VAL                                                 'H%3Ai%3As'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        INIT_FCALL                                               'gettime'
         17        DO_FCALL                                      0  $9      
         18        IS_IDENTICAL                                     ~10     $8, $9
         19        ADD_ARRAY_ELEMENT                                ~7      ~10
   34    20        INIT_FCALL                                               'date'
         21        SEND_VAL                                                 'H%3Ai%3As'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $11     
         24        INIT_FCALL                                               'gettime'
         25        SEND_VAL                                                 'H%3Ai%3As'
         26        DO_FCALL                                      0  $12     
         27        IS_IDENTICAL                                     ~13     $11, $12
         28        ADD_ARRAY_ELEMENT                                ~7      ~13
   35    29        INIT_FCALL                                               'date'
         30        SEND_VAL                                                 'H%3Ai'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $14     
         33        INIT_FCALL                                               'gettime'
         34        SEND_VAL                                                 'H%3Ai'
         35        SEND_VAR                                                 !0
         36        DO_FCALL                                      0  $15     
         37        IS_IDENTICAL                                     ~16     $14, $15
         38        ADD_ARRAY_ELEMENT                                ~7      ~16
   36    39        INIT_FCALL                                               'date'
         40        SEND_VAL                                                 'H%3Ai'
         41        SEND_VAR                                                 !0
         42        DO_ICALL                                         $17     
         43        INIT_FCALL                                               'gettime'
         44        SEND_VAR                                                 !0
         45        SEND_VAL                                                 'H%3Ai'
         46        DO_FCALL                                      0  $18     
         47        IS_IDENTICAL                                     ~19     $17, $18
         48        ADD_ARRAY_ELEMENT                                ~7      ~19
   31    49        ASSIGN                                                   !1, ~7
   38    50        INIT_FCALL                                               'var_dump'
         51        SEND_VAR                                                 !1
         52        DO_ICALL                                                 
   39    53      > RETURN                                                   null

End of function testgettime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.96 ms | 1407 KiB | 27 Q