3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getUsersData( \PDO $pdo) { $query = $pdo->query( "SELECT name,mail FROM users" ); return $query->fetchAll( PDO::FETCH_OBJ ) ; } function calculateDate( $date ) { $currentDate = new DateTime(); $diff = $currentDate->diff( new DateTime($date) ) ; return $diff; } $users = getUsersData($connection); foreach( $users as $user ){ $dateEnd = calculateDate( $user->date ); $message = sprintf("Twoj abonamnet konczy sie %s" , $dateEnd->format("d-m-Y")); // mailer }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 20
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 20
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/jWhUp
function name:  (null)
number of ops:  22
compiled vars:  !0 = $users, !1 = $connection, !2 = $user, !3 = $dateEnd, !4 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'getusersdata'
          1        SEND_VAR                                                 !1
          2        DO_FCALL                                      0  $5      
          3        ASSIGN                                                   !0, $5
   17     4      > FE_RESET_R                                       $7      !0, ->20
          5    > > FE_FETCH_R                                               $7, !2, ->20
   19     6    >   INIT_FCALL                                               'calculatedate'
          7        FETCH_OBJ_R                                      ~8      !2, 'date'
          8        SEND_VAL                                                 ~8
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !3, $9
   21    11        INIT_FCALL                                               'sprintf'
         12        SEND_VAL                                                 'Twoj+abonamnet+konczy+sie+%25s'
         13        INIT_METHOD_CALL                                         !3, 'format'
         14        SEND_VAL_EX                                              'd-m-Y'
         15        DO_FCALL                                      0  $11     
         16        SEND_VAR                                                 $11
         17        DO_ICALL                                         $12     
         18        ASSIGN                                                   !4, $12
   17    19      > JMP                                                      ->5
         20    >   FE_FREE                                                  $7
   24    21      > RETURN                                                   1

Function getusersdata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jWhUp
function name:  getUsersData
number of ops:  10
compiled vars:  !0 = $pdo, !1 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_METHOD_CALL                                         !0, 'query'
          2        SEND_VAL_EX                                              'SELECT+name%2Cmail+FROM+users'
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
    5     5        INIT_METHOD_CALL                                         !1, 'fetchAll'
          6        SEND_VAL_EX                                              5
          7        DO_FCALL                                      0  $4      
          8      > RETURN                                                   $4
    6     9*     > RETURN                                                   null

End of function getusersdata

Function calculatedate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jWhUp
function name:  calculateDate
number of ops:  13
compiled vars:  !0 = $date, !1 = $currentDate, !2 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        NEW                                              $3      'DateTime'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   11     4        INIT_METHOD_CALL                                         !1, 'diff'
          5        NEW                                              $6      'DateTime'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8        SEND_VAR_NO_REF_EX                                       $6
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !2, $8
   12    11      > RETURN                                                   !2
   13    12*     > RETURN                                                   null

End of function calculatedate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.09 ms | 1403 KiB | 17 Q