3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $info1 = array();$info2 = array();$info3 = array();$info4 = array(); $info1['multiply'] = $info2['multiply'] = $info3['multiply'] = 1000; $info2['close'] = 51.74; $info2['high'] = 52.017; $info2['open'] = 51.687; $info2['low'] = 51.666; $info1['close'] = 51.74; $info1['high'] = 52.017; $info1['open'] = 51.687; $info1['low'] = 51.666; $info3['close'] = 51.731; $info3['high'] = 52.013; $info3['open'] = 51.744; $info3['low'] = 51.703; $info4['close'] = 51.692; $info4['high'] = 51.955; $info4['open'] = 51.732; $info4['low'] = 51.692; $typicalSpread = 2; $spikes = array(); if (abs($info1['close'] * $info1['multiply'] - $info2['high'] * $info1['multiply']) >= $typicalSpread) { if (abs($info2['high'] * $info1['multiply'] - $info3['open'] * $info1['multiply']) >= $typicalSpread) { if (abs($info3['high'] * $info1['multiply'] - $info2['close'] * $info1['multiply']) < $typicalSpread && abs($info3['high'] * $info1['multiply'] - $info4['open'] * $info1['multiply']) < $typicalSpread) { $spikes[] = 'first'; } } else { if (abs($info3['high'] * $info1['multiply'] - $info2['close'] * $info1['multiply']) < $typicalSpread && abs($info3['high'] * $info1['multiply'] - $info4['open'] * $info1['multiply']) >= $typicalSpread) { $spikes[] = 'second'; } } } if (abs($info1['close'] * $info1['multiply'] - $info2['low'] * $info1['multiply']) >= $typicalSpread) { if (abs($info2['low'] * $info1['multiply'] - $info3['open'] * $info1['multiply']) >= $typicalSpread) { if (abs($info3['low'] * $info1['multiply'] - $info2['close'] * $info1['multiply']) < $typicalSpread && abs($info3['low'] * $info1['multiply'] - $info4['open'] * $info1['multiply']) < $typicalSpread) { $spikes[] = 'third'; } } else { if (abs($info3['low'] * $info1['multiply'] - $info2['close'] * $info1['multiply']) < $typicalSpread && abs($info3['low'] * $info1['multiply'] - $info4['open'] * $info1['multiply']) >= $typicalSpread) { $spikes[] = 'fourth'; } } } var_dump($spikes);
based on CB24C
Output for 4.3.0 - 7.2.0
array(0) { }