Comments (5)
It throws an error. Only built-in typeof operator handles checks for non-existing variables in JavaScript, so the empty() function in phpjs has a limitation, which cannot be handled. In fact, the isset and empty in PHP are not real functions, they are language constructs, that look similar to functions, but have often "greater powers".
from locutus.
Rofl,
too bad.. I'm tired to use typeof blabla =='undefined' blabla
too long when i've 300000 test vars...
from locutus.
Well, PHP and JavaScript differ in many ways, so not everything can be ported from one to another. In PHP for instance there is no explicit variable declaration, so the isset/empty make sense. In JavaScript using undeclared variables leads to many problems, so you should just avoid such practices.
from locutus.
yep but when i try to access to an object parameter in my view and when the object is undefined. i must try the object first, next the params...etc
it's little complicated for nothing.
from locutus.
Not something we'll fix anyway, sorry.
from locutus.
Related Issues (20)
- bin2hex() fails with unicode characters like Æ Ø Å æ ø å
- "contributing guidelines coding standards" url broken HOT 2
- [php/array/array_intersect.js] Simpler option HOT 3
- float bug and missing Q code HOT 2
- Linting upgrade HOT 1
- Failure to recognize some format and extract values in sscanf HOT 2
- [c/stdio/sprintf] %% consumes an extra arg HOT 5
- Question: Is strtotime Algorithmically Equivalent to the PHP Version? HOT 2
- hex2bin() Never Returns If More Than 1 Million Chars HOT 3
- Percentage for "similar_text" HOT 2
- Trying to get in touch regarding a security issue HOT 3
- strip_tags has some differences with php's version HOT 1
- Invalid syntax '/php/_helpers/_bc' in released '_locutus_shared/_locutus_shared_bc.js' HOT 2
- TypeError: Cannot read property '$locutus' of undefined HOT 1
- BUG : php function unserialize not working HOT 6
- php similar_text performance HOT 4
- Invalid serialization for floating numbers HOT 1
- Help - How install with Ionic? HOT 1
- bcmul is not working with decimal HOT 2
- fmod: toFixed() digits argument must be between 0 and 100
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 locutus.