# Removing redundant shebang line check

- Thread: https://externals.io/message/39536
- Original archive: https://news-web.php.net/php.internals/39536
- Started by Dmitry Stogov on 2008-08-01T11:40:56+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #39536 — Dmitry Stogov — 2008-08-01T11:40:56+00:00

URL: https://externals.io/message/39536#39536

Hi,

The proposed patch removes code that implemented shebang line support
(#! /usr/bin/php). Starting with PHP-5.3 it is handled by scanner, and
we don't need to check it twice.

With this check removed, it's become possible to eliminate the open()
syscall (and also several `fstat()` and mmap() calls) for the requested
file with opcode caches. The patch does it by replacing VCWD_FOPEN() in
php_fopen_primary_script() by zend_open_stream() which call for callback
that can be overridden by opcode cache.

I like to commit it into HEAD and PHP_5_3 on weekend.
I hope nobody have objections.

Thanks. Dmitry.
