3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * Getting MAC Address using PHP * Md. Nazmul Basher */ ob_start(); // Turn on output buffering system(' /sbin/ifconfig | grep HWaddr'); //Execute external program to display output $mycom=ob_get_contents(); // Capture the output into a variable ob_clean(); // Clean (erase) the output buffer echo $mycom;die; $findme = 'Physical'; $pmac = strpos($mycom, $findme); // Find the position of Physical text $mac=substr($mycom,($pmac+36),17); // Get Physical Address echo $mac;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/hTNbE
function name:  (null)
number of ops:  27
compiled vars:  !0 = $mycom, !1 = $findme, !2 = $pmac, !3 = $mac
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'ob_start'
          1        DO_ICALL                                                 
    8     2        INIT_FCALL                                               'system'
          3        SEND_VAL                                                 '%0A%2Fsbin%2Fifconfig+%7C+grep+HWaddr'
          4        DO_ICALL                                                 
   10     5        INIT_FCALL                                               'ob_get_contents'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !0, $6
   11     8        INIT_FCALL                                               'ob_clean'
          9        DO_ICALL                                                 
   13    10        ECHO                                                     !0
         11      > EXIT                                                     
   15    12*       ASSIGN                                                   !1, 'Physical'
   16    13*       INIT_FCALL                                               'strpos'
         14*       SEND_VAR                                                 !0
         15*       SEND_VAR                                                 !1
         16*       DO_ICALL                                         $10     
         17*       ASSIGN                                                   !2, $10
   17    18*       INIT_FCALL                                               'substr'
         19*       SEND_VAR                                                 !0
         20*       ADD                                              ~12     !2, 36
         21*       SEND_VAL                                                 ~12
         22*       SEND_VAL                                                 17
         23*       DO_ICALL                                         $13     
         24*       ASSIGN                                                   !3, $13
   19    25*       ECHO                                                     !3
         26*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.65 ms | 1395 KiB | 25 Q