3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $reply = "18701880775,woca,2015-11-13 15:32:22.0"; $data = explode(";", $reply); foreach ($data as $k => $v) { $sms = explode(',', $v); if(!$v['0']) { continue; } $fields['su_from'] = 4; // 1众览 2建周 $fields['su_mid'] = $S->getMidByPhone($v['0']) ? $S->getMidByPhone($v['0']) : 0; $fields['su_mobile'] = $sms['0']; $fields['su_content'] = $sms['1']; $fields['su_time'] = $sms['2']; $fields['su_extenion'] = ''; $fields['su_create_time'] = '=NOW()'; $fields['su_create_time'] = '=NOW()'; var_dump($fields); }
based on BhN17
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: S in /in/0pYnl on line 12 Fatal error: Uncaught Error: Call to a member function getMidByPhone() on null in /in/0pYnl:12 Stack trace: #0 {main} thrown in /in/0pYnl on line 12
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: S in /in/0pYnl on line 12 Fatal error: Uncaught Error: Call to a member function getMidByPhone() on unknown in /in/0pYnl:12 Stack trace: #0 {main} thrown in /in/0pYnl on line 12
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Undefined variable: S in /in/0pYnl on line 12 Fatal error: Call to a member function getMidByPhone() on null in /in/0pYnl on line 12
Process exited with code 255.
Output for 5.3.19 - 5.5.35
Notice: Undefined variable: S in /in/0pYnl on line 12 Fatal error: Call to a member function getMidByPhone() on a non-object in /in/0pYnl on line 12
Process exited with code 255.