3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = json_decode('{ "lifeExp": "2 Days", "certificates": [ { "name": "CCS Group Pte Ltd", "signed": "22/05/2020 10:31:00", "revoked": "23/05/2020 5:40:00", "files": { "p12": "certificates/:id/certificate.p12", "pem": "certificates/:id/certificate.pem", "key": "certificates/:id/certificate.key", "password": "certificates/:id/certificate.password" } }, { "name": "Hoola Inc", "signed": "16/05/2020 12:40:00", "revoked": "19/05/2020 04:00:00", "files": { "p12": "certificates/:id/certificate.p12", "pem": "certificates/:id/certificate.pem", "key": "certificates/:id/certificate.key", "password": "certificates/:id/certificate.password" } } ] }', true); $signed = $json['certificates'][1]['signed']; $revoked = $json['certificates'][1]['revoked']; $newTimeAdd = DateTime::createFromFormat('d/m/Y H:i:s', $signed); $newTimeRead = DateTime::createFromFormat('d/m/Y H:i:s', $revoked); $interval = $newTimeAdd->diff($newTimeRead); echo $interval->days;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdGrk
function name:  (null)
number of ops:  30
compiled vars:  !0 = $json, !1 = $signed, !2 = $revoked, !3 = $newTimeAdd, !4 = $newTimeRead, !5 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%0A++++%22lifeExp%22%3A+%222+Days%22%2C%0A++++%22certificates%22%3A+%5B%0A++++++++%7B%0A++++++++++++%22name%22%3A+%22CCS+Group+Pte+Ltd%22%2C%0A++++++++++++%22signed%22%3A+%2222%2F05%2F2020+10%3A31%3A00%22%2C%0A++++++++++++%22revoked%22%3A+%2223%2F05%2F2020+5%3A40%3A00%22%2C%0A++++++++++++%22files%22%3A+%7B%0A++++++++++++++++%22p12%22%3A+%22certificates%2F%3Aid%2Fcertificate.p12%22%2C%0A++++++++++++++++%22pem%22%3A+%22certificates%2F%3Aid%2Fcertificate.pem%22%2C%0A++++++++++++++++%22key%22%3A+%22certificates%2F%3Aid%2Fcertificate.key%22%2C%0A++++++++++++++++%22password%22%3A+%22certificates%2F%3Aid%2Fcertificate.password%22%0A++++++++++++%7D%0A++++++++%7D%2C%0A++++++++%7B%0A++++++++++++%22name%22%3A+%22Hoola+Inc%22%2C%0A++++++++++++%22signed%22%3A+%2216%2F05%2F2020+12%3A40%3A00%22%2C%0A++++++++++++%22revoked%22%3A+%2219%2F05%2F2020+04%3A00%3A00%22%2C%0A++++++++++++%22files%22%3A+%7B%0A++++++++++++++++%22p12%22%3A+%22certificates%2F%3Aid%2Fcertificate.p12%22%2C%0A++++++++++++++++%22pem%22%3A+%22certificates%2F%3Aid%2Fcertificate.pem%22%2C%0A++++++++++++++++%22key%22%3A+%22certificates%2F%3Aid%2Fcertificate.key%22%2C%0A++++++++++++++++%22password%22%3A+%22certificates%2F%3Aid%2Fcertificate.password%22%0A++++++++++++%7D%0A++++++++%7D%0A++++%5D%0A%7D'
   29     2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $6      
    3     4        ASSIGN                                                   !0, $6
   31     5        FETCH_DIM_R                                      ~8      !0, 'certificates'
          6        FETCH_DIM_R                                      ~9      ~8, 1
          7        FETCH_DIM_R                                      ~10     ~9, 'signed'
          8        ASSIGN                                                   !1, ~10
   32     9        FETCH_DIM_R                                      ~12     !0, 'certificates'
         10        FETCH_DIM_R                                      ~13     ~12, 1
         11        FETCH_DIM_R                                      ~14     ~13, 'revoked'
         12        ASSIGN                                                   !2, ~14
   34    13        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         14        SEND_VAL                                                 'd%2Fm%2FY+H%3Ai%3As'
         15        SEND_VAR                                                 !1
         16        DO_FCALL                                      0  $16     
         17        ASSIGN                                                   !3, $16
   35    18        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         19        SEND_VAL                                                 'd%2Fm%2FY+H%3Ai%3As'
         20        SEND_VAR                                                 !2
         21        DO_FCALL                                      0  $18     
         22        ASSIGN                                                   !4, $18
   36    23        INIT_METHOD_CALL                                         !3, 'diff'
         24        SEND_VAR_EX                                              !4
         25        DO_FCALL                                      0  $20     
         26        ASSIGN                                                   !5, $20
   37    27        FETCH_OBJ_R                                      ~22     !5, 'days'
         28        ECHO                                                     ~22
   38    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.49 ms | 1400 KiB | 15 Q