일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- JavaScript
- 이미지바꾸기
- Ionic
- 자바스크립개념
- typescript
- error
- zsh
- getElementsByClassName
- change detection
- hashchange
- oh-my-zsh
- code .
- php
- aab 배포
- fromEvent
- VSCode
- angular5
- IONIC3
- angular
- border-width
- Sentry
- Visual Studio Code
- ion-range
- 테두리굵기
- sealize
- 변화감지
- Git
- NVM
- ChangeDetectorRef
- rxjs
- Today
- Total
hsunny study blog
-> 와 =>의 차이점 본문
-> (= Object Operator)
객체 범위 내에서 객체에 접근하기 위해서 사용하는 오퍼레이터입니다.
=> (= Double Arrow Operator)
배열의 키, 값을 할당할 때 사용하는 오퍼레이터입니다.
사용 예
<?php
$arr1 = array("key1"=>"value1", "key2"=>"value2");
echo arr1["key1"]; // value1
echo arr1["key2"]; // value2
echo arr1->key1; // undefined
echo arr1->key2; // undefined
$obj = (object)$arr1; // array를 object로 형변환하여 사용
echo obj ->key1; // value1
echo obj ->key2; // value2
/* ------------------------------------------------- */
$arr2 = array("key1->"value1"); // error
|
<?php
class foo
{
function do_foo()
{
echo "Doing foo.";
}
}
$bar = new foo;
$bar->do_foo();
|
참고사이트
https://stackoverflow.com/questions/14037290/what-does-this-mean-in-php-or
What Does This Mean in PHP -> or =>
Possible Duplicate: where we use object operator “->” in php Reference - What does this symbol mean in PHP? I see these in PHP all the time but I don't have a clue as to what they actuall...
stackoverflow.com
https://www.php.net/manual/en/language.types.object.php
PHP: Objects - Manual
If you call var_export() on an instance of stdClass, it attempts to export it using ::__set_state(), which, for some reason, is not implemented in stdClass.However, casting an associative array to an object usually produces the same effect (at least, it do
www.php.net
*PHP에서 사용하는 연산자들에 대한 설명을 한 곳에 모아둔 stackoverflow 글 공유합니다.
굉장히 유용할 것 같습니다!
https://stackoverflow.com/questions/14037290/what-does-this-mean-in-php-or
What Does This Mean in PHP -> or =>
Possible Duplicate: where we use object operator “->” in php Reference - What does this symbol mean in PHP? I see these in PHP all the time but I don't have a clue as to what they actuall...
stackoverflow.com
'programming > PHP' 카테고리의 다른 글
apachectl (0) | 2021.03.07 |
---|---|
PDO 적용기 (0) | 2020.12.27 |
전화번호 정규식 (0) | 2020.08.31 |
쿼리스트링 형식을 변수로 인식하는 parse_str() (0) | 2019.10.05 |
배열을 하나의 문자열로 만드는 함수 (0) | 2019.07.21 |