Comments (3)
Since &&
always returns boolean result, these lines are not always identical:
$y = $x && foo($x);
if ($x) { $y = foo($x); }
Unless foo()
returns bool type, that is.
In your particular example, foo()
returns int.
The first snippet will have $y=true
and the second snippet will have $y=1
.
from kphp.
Return type of the function is not the point of the issue, the point is smart cast only. But I've fixed the example to have correct types, thanks.
from kphp.
Basically the same as #711.
from kphp.
Related Issues (20)
- Feature Request: Add an option for preprocessing PHP code before parsing
- Profile Guided Optimization (PGO) to improve kphp performance
- PHP 7
- Add an annotation to mark function or class as forkable
- Allow to interrupt job worker from outside HOT 2
- "Illegal instruction" for every `kphp` call in Docker container HOT 6
- Compilation error when using `nested list()`
- Different behaviour of casting array to int in PHP and KPHP HOT 1
- Add the ability to cast an object to `mixed` type HOT 2
- Compilation terminated due to errors, when compile my.php HOT 6
- Add an analog of `disable_functions`
- Update documentation
- Support skipping default values in MessagePack serialization
- You can access properties via `$` and its name HOT 1
- KVK - Компилятор В Комплекте - название языка
- tl2php не генерирует RpcResponse. HOT 1
- Static method `new` is unsupported in generics
- cli mode bug on docker HOT 2
- http does not work for mac os
- Incorrect library directories when building on RPM-based Linux distributions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kphp.