3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "blah 2015 yar"; $pos = strpos($string, "20"); $year = substr($string, $pos, 4); echo $year; $end_year = "12/31/" . $year; $end_time = new DateTime($end_year); $start_time = new DateTime(); $diff = $end_time ->diff($start_time); var_dump($diff); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dkhOG
function name:  (null)
number of ops:  30
compiled vars:  !0 = $string, !1 = $pos, !2 = $year, !3 = $end_year, !4 = $end_time, !5 = $start_time, !6 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'blah+2015+yar'
    3     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '20'
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
    4     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 4
         10        DO_ICALL                                         $10     
         11        ASSIGN                                                   !2, $10
    5    12        ECHO                                                     !2
    7    13        CONCAT                                           ~12     '12%2F31%2F', !2
         14        ASSIGN                                                   !3, ~12
    8    15        NEW                                              $14     'DateTime'
         16        SEND_VAR_EX                                              !3
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !4, $14
    9    19        NEW                                              $17     'DateTime'
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !5, $17
   10    22        INIT_METHOD_CALL                                         !4, 'diff'
         23        SEND_VAR_EX                                              !5
         24        DO_FCALL                                      0  $20     
         25        ASSIGN                                                   !6, $20
   11    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !6
         28        DO_ICALL                                                 
   14    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.26 ms | 1387 KiB | 19 Q