3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ ['name' => 'Mathmatics', 'time' => '03:01:PM - 04:50:PM'], ['name' => 'History', 'time' => '11:30:AM - 01:30:PM'], ['name' => 'French', 'time' => '01:31:PM - 03:00:PM'], ]; foreach ($arr as $a) { var_export(DateTime::createFromFormat('h:i:A - h:i:A', $a['time'])); echo "\n"; }

preferences:
33.48 ms | 404 KiB | 5 Q