3v4l.org

run code in 300+ PHP versions simultaneously
<?php function inRange($x, $a, $b) { return $x >= $a && $x <= $b; } // No args $now = time(); touch("/tmp/test0"); $fileInfo = new SplFileInfo("/tmp/test0"); print(inRange($fileInfo->getATime(), $now, $now + 10)."\n"); print(inRange($fileInfo->getMTime(), $now, $now + 10)."\n"); // Mofification time only touch("/tmp/test1", strtotime("2005-10-15")); $fileInfo = new SplFileInfo("/tmp/test1"); print($fileInfo->getATime()."\n"); print($fileInfo->getMTime()."\n"); // Modification and access time touch("/tmp/test2", strtotime("2005-10-15"), strtotime("2010-10-15")); $fileInfo = new SplFileInfo("/tmp/test2"); print($fileInfo->getATime()."\n"); print($fileInfo->getMTime()."\n");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5aeLu
function name:  (null)
number of ops:  73
compiled vars:  !0 = $now, !1 = $fileInfo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $2      
          2        ASSIGN                                                   !0, $2
    9     3        INIT_FCALL                                               'touch'
          4        SEND_VAL                                                 '%2Ftmp%2Ftest0'
          5        DO_ICALL                                                 
   10     6        NEW                                              $5      'SplFileInfo'
          7        SEND_VAL_EX                                              '%2Ftmp%2Ftest0'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
   11    10        INIT_FCALL                                               'inrange'
         11        INIT_METHOD_CALL                                         !1, 'getATime'
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR                                                 $8
         14        SEND_VAR                                                 !0
         15        ADD                                              ~9      !0, 10
         16        SEND_VAL                                                 ~9
         17        DO_FCALL                                      0  $10     
         18        CONCAT                                           ~11     $10, '%0A'
         19        ECHO                                                     ~11
   12    20        INIT_FCALL                                               'inrange'
         21        INIT_METHOD_CALL                                         !1, 'getMTime'
         22        DO_FCALL                                      0  $12     
         23        SEND_VAR                                                 $12
         24        SEND_VAR                                                 !0
         25        ADD                                              ~13     !0, 10
         26        SEND_VAL                                                 ~13
         27        DO_FCALL                                      0  $14     
         28        CONCAT                                           ~15     $14, '%0A'
         29        ECHO                                                     ~15
   15    30        INIT_FCALL                                               'touch'
         31        SEND_VAL                                                 '%2Ftmp%2Ftest1'
         32        INIT_FCALL                                               'strtotime'
         33        SEND_VAL                                                 '2005-10-15'
         34        DO_ICALL                                         $16     
         35        SEND_VAR                                                 $16
         36        DO_ICALL                                                 
   16    37        NEW                                              $18     'SplFileInfo'
         38        SEND_VAL_EX                                              '%2Ftmp%2Ftest1'
         39        DO_FCALL                                      0          
         40        ASSIGN                                                   !1, $18
   17    41        INIT_METHOD_CALL                                         !1, 'getATime'
         42        DO_FCALL                                      0  $21     
         43        CONCAT                                           ~22     $21, '%0A'
         44        ECHO                                                     ~22
   18    45        INIT_METHOD_CALL                                         !1, 'getMTime'
         46        DO_FCALL                                      0  $23     
         47        CONCAT                                           ~24     $23, '%0A'
         48        ECHO                                                     ~24
   21    49        INIT_FCALL                                               'touch'
         50        SEND_VAL                                                 '%2Ftmp%2Ftest2'
         51        INIT_FCALL                                               'strtotime'
         52        SEND_VAL                                                 '2005-10-15'
         53        DO_ICALL                                         $25     
         54        SEND_VAR                                                 $25
         55        INIT_FCALL                                               'strtotime'
         56        SEND_VAL                                                 '2010-10-15'
         57        DO_ICALL                                         $26     
         58        SEND_VAR                                                 $26
         59        DO_ICALL                                                 
   22    60        NEW                                              $28     'SplFileInfo'
         61        SEND_VAL_EX                                              '%2Ftmp%2Ftest2'
         62        DO_FCALL                                      0          
         63        ASSIGN                                                   !1, $28
   23    64        INIT_METHOD_CALL                                         !1, 'getATime'
         65        DO_FCALL                                      0  $31     
         66        CONCAT                                           ~32     $31, '%0A'
         67        ECHO                                                     ~32
   24    68        INIT_METHOD_CALL                                         !1, 'getMTime'
         69        DO_FCALL                                      0  $33     
         70        CONCAT                                           ~34     $33, '%0A'
         71        ECHO                                                     ~34
         72      > RETURN                                                   1

Function inrange:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/5aeLu
function name:  inRange
number of ops:  9
compiled vars:  !0 = $x, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        IS_SMALLER_OR_EQUAL                              ~3      !1, !0
          4      > JMPZ_EX                                          ~3      ~3, ->7
          5    >   IS_SMALLER_OR_EQUAL                              ~4      !0, !2
          6        BOOL                                             ~3      ~4
          7    > > RETURN                                                   ~3
    5     8*     > RETURN                                                   null

End of function inrange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.94 ms | 948 KiB | 22 Q