Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i have read this sentence in the object oriented paradigm approach.
A class can never have property values or state. Only objects can.
Can anybody elaborate this ?
Think of a class as a definition of a new data type. As such, it cannot have a state - it's just a definition. Consider this analogy - the concept of integer can't have a value, but a specific variable of integer type may have the value of 7.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
As of PHP 7 we have access to anonymous classes. This means we could ditch stdClass when we need generic object as a return value... But which one would be cleaner?
What other differences are between those two guys?
Is there any performance drawback on creating an anonymous class? i.e. as each one has a different "class name", is there any additional impact?
Do both work "the same way" from the developer point of view, or are they actually two different beasts in some cases?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Hello,
I'm making an application in which I have the points (p0,p1), and need to find the points for perpendicular segments at the end of (p0,p1)... namely, (A,B) and (C,D), which are of length $len.
There is a similar question to this one in this post, but unfortunately I am not sure about how to interpret the answer...
I'm using php for this project, but the solution can be in any language as I can translate it later.
(A-E)/(l/2) = (p1-F)/L
and so on...
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What is the difference between:
$table->string('some_text');
and:
$table->text('some_text');
in Laravel?
Please, if you can be comprehensive. Thank you.
As defined here:
$table->string() uses a VARCHAR equivalent
$table->text() uses a TEXT equivalent
(The actual types can depend on the database system)
The obvious difference is that VARCHAR has a specified length (default with string() is 255 characters) whereas TEXT doesn't have that.
Here is a comparison of the two types in MySQL
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What might be some benefits of array type hinting in methods and functions in PHP besides documentation and readability?
Generally, the sooner you catch an error the easier it is to diagnose. Type hinging in php allows those errors to occur earlier than if something does wrong down in the function or in functions that it calls.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm looking for a class or a function, or just a piece of code that would do Principal Component Analysis (PCA) in PHP. I am interested in reducing dimensionality of some data.
I know that PHP is not the right language for heavy computation, so please don't suggest to use another language!