3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateInvoicePath($orderId) { // ALARMA ! Code récupéré tel quel de OSCommerce if(substr($orderId,0,2)%2 == 1)//impair { $fin = substr($orderId,0,2); $deb = $fin-1; $dossier = $deb.'000-'.$fin.'999'; } else //pair { $deb = substr($orderId,0,2); $fin = $deb+1; $dossier = $deb.'000-'.$fin.'999'; } $sous_dossier = substr($orderId,0,3).'00-'.substr($orderId,0,3).'99'; // J'ai quand même fait un sprintf, parce qu'il faut pas déconner ;-) return sprintf("%s/%s/fac%s%s.pdf", $dossier, $sous_dossier, $orderId, md5($orderId)); } echo generateInvoicePath(66579);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f1YJo
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'generateinvoicepath'
          1        SEND_VAL                                                 66579
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function generateinvoicepath:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f1YJo
function name:  generateInvoicePath
number of ops:  60
compiled vars:  !0 = $orderId, !1 = $fin, !2 = $deb, !3 = $dossier, !4 = $sous_dossier
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 2
          5        DO_ICALL                                         $5      
          6        MOD                                              ~6      $5, 2
          7        IS_EQUAL                                                 ~6, 1
          8      > JMPZ                                                     ~7, ->22
    7     9    >   INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 2
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !1, $8
    8    15        SUB                                              ~10     !1, 1
         16        ASSIGN                                                   !2, ~10
    9    17        CONCAT                                           ~12     !2, '000-'
         18        CONCAT                                           ~13     ~12, !1
         19        CONCAT                                           ~14     ~13, '999'
         20        ASSIGN                                                   !3, ~14
         21      > JMP                                                      ->34
   13    22    >   INIT_FCALL                                               'substr'
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 0
         25        SEND_VAL                                                 2
         26        DO_ICALL                                         $16     
         27        ASSIGN                                                   !2, $16
   14    28        ADD                                              ~18     !2, 1
         29        ASSIGN                                                   !1, ~18
   15    30        CONCAT                                           ~20     !2, '000-'
         31        CONCAT                                           ~21     ~20, !1
         32        CONCAT                                           ~22     ~21, '999'
         33        ASSIGN                                                   !3, ~22
   18    34    >   INIT_FCALL                                               'substr'
         35        SEND_VAR                                                 !0
         36        SEND_VAL                                                 0
         37        SEND_VAL                                                 3
         38        DO_ICALL                                         $24     
         39        CONCAT                                           ~25     $24, '00-'
         40        INIT_FCALL                                               'substr'
         41        SEND_VAR                                                 !0
         42        SEND_VAL                                                 0
         43        SEND_VAL                                                 3
         44        DO_ICALL                                         $26     
         45        CONCAT                                           ~27     ~25, $26
         46        CONCAT                                           ~28     ~27, '99'
         47        ASSIGN                                                   !4, ~28
   21    48        INIT_FCALL                                               'sprintf'
         49        SEND_VAL                                                 '%25s%2F%25s%2Ffac%25s%25s.pdf'
         50        SEND_VAR                                                 !3
         51        SEND_VAR                                                 !4
         52        SEND_VAR                                                 !0
         53        INIT_FCALL                                               'md5'
         54        SEND_VAR                                                 !0
         55        DO_ICALL                                         $30     
         56        SEND_VAR                                                 $30
         57        DO_ICALL                                         $31     
         58      > RETURN                                                   $31
   22    59*     > RETURN                                                   null

End of function generateinvoicepath

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.89 ms | 1407 KiB | 20 Q