3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '18 hours and 14 minutes ago'; $regex = '#\d+\s\w+#'; preg_match_all($regex, $string, $matches); $date = new DateTime(); echo 'current date = '.$date->format('Y-m-d H:i:s')."\n"; foreach ($matches[0] as $modify) { $date->modify('-'.$modify); } echo 'modified date = '.$date->format('Y-m-d H:i:s');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/LL4R0
function name:  (null)
number of ops:  31
compiled vars:  !0 = $string, !1 = $regex, !2 = $matches, !3 = $date, !4 = $modify
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '18+hours+and+14+minutes+ago'
    4     1        ASSIGN                                                   !1, '%23%5Cd%2B%5Cs%5Cw%2B%23'
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    6     7        NEW                                              $8      'DateTime'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $8
    7    10        INIT_METHOD_CALL                                         !3, 'format'
         11        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         12        DO_FCALL                                      0  $11     
         13        CONCAT                                           ~12     'current+date+%3D+', $11
         14        CONCAT                                           ~13     ~12, '%0A'
         15        ECHO                                                     ~13
    8    16        FETCH_DIM_R                                      ~14     !2, 0
         17      > FE_RESET_R                                       $15     ~14, ->24
         18    > > FE_FETCH_R                                               $15, !4, ->24
    9    19    >   INIT_METHOD_CALL                                         !3, 'modify'
         20        CONCAT                                           ~16     '-', !4
         21        SEND_VAL_EX                                              ~16
         22        DO_FCALL                                      0          
    8    23      > JMP                                                      ->18
         24    >   FE_FREE                                                  $15
   11    25        INIT_METHOD_CALL                                         !3, 'format'
         26        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         27        DO_FCALL                                      0  $18     
         28        CONCAT                                           ~19     'modified+date+%3D+', $18
         29        ECHO                                                     ~19
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.81 ms | 1006 KiB | 14 Q