12

Reading this fascinating question made me remember a code snippet I stumbled across a few weeks ago; it gave me quite a few minutes of confusion until I figured out why it works, maybe it will be interesting for others as well.

<?php

http://example.com/some-article
$items = get_items();
// etc.

Obviously the programmer wanted to add an explanatory link as a comment before the code block, but forgot to add the // to the beginning. Nevertheless, the code works fine. Can you tell why?

Community
  • 1
  • 1
Tgr
  • 27,442
  • 12
  • 81
  • 118

1 Answers1

20

The http: is a goto label, and the rest of the line is commented out.

kapa
  • 77,694
  • 21
  • 158
  • 175
Brandon
  • 658
  • 2
  • 9
  • 19